const getOpenId = require('./getOpenId/index');
const getMiniProgramCode = require('./getMiniProgramCode/index');
const createCollection = require('./createCollection/index');
const selectRecord = require('./selectRecord/index');
const updateRecord = require('./updateRecord/index');
const sumRecord = require('./sumRecord/index');
const uploadImage = require('./uploadImage/index');
const updateUserInfo = require('./updateUserInfo/index');
const addMessage = require('./addMessage/index');
const comment = require('./comment/index');
const getEage = require('./getEdge/index');
const getInfo = require('./getInfo/index');
const message = require('./message/index');
const addEdge = require('./addEdge/index');
const getEdgeDetail = require('./getEdgeDetail/index');
const updateEdgeLike = require('./updateEdgeLike/index');
const searchFriend = require('./searchFriend/index');
const getUserEdge = require('./getUserEdge/index');
const follower = require('./follower/index');
const getDetailStore = require('./getDetailStore/index')
const getFollower = require('./getFollower/index');
const feedback = require('./feedback/index');

// 云函数入口函数
exports.main = async (event, context) => {
	switch (event.type) {
		case 'getOpenId':
			return await getOpenId.main(event, context);
		case 'getMiniProgramCode':
			return await getMiniProgramCode.main(event, context);
		case 'createCollection':
			return await createCollection.main(event, context);
		case 'selectRecord':
			return await selectRecord.main(event, context);
		case 'updateRecord':
			return await updateRecord.main(event, context);
		case 'sumRecord':
			return await sumRecord.main(event, context);
		case 'uploadImage':
			console.log(uploadImage.main(event, context))
			return await uploadImage.main(event, context);
		case 'updateUserInfo':
			return updateUserInfo.main(event, context);
		case 'addMessage':
			return addMessage.main(event, context);
		case 'comment':
			return comment.main(event, context);
		case 'getEage':
			return getEage.main(event, context);
		case 'getInfo':
			return getInfo.main(event, context);
		case 'message':
			return message.main(event, context);
		case 'addEdge':
			return addEdge.main(event, context);
		case 'getEdgeDetail':
			return getEdgeDetail.main(event, context);
		case 'updateEdgeLike':
			return updateEdgeLike.main(event, context);
		case 'searchFriend':
			return searchFriend.main(event, context);
		case 'getUserEdge':
			return getUserEdge.main(event, context);
		case 'follower':
			return follower.main(event, context);
		case 'getFollower':
			return getFollower.main(event, context);
		case 'feedback':
			return feedback.main(event, context);
		case 'getDetailStore':
			return getDetailStore.main(event, context);
	}
};
